/*=============================================================================
#     FileName: AacDecoder.h
#         Desc: 
#       Author: zhfayuan
#        Email: afst2012@outlook.com
#      Version: 0.0.1
#   LastChange: 2020-10-12 21:54:03
#      History:
=============================================================================*/

#ifndef __AAC_DECODER_H__
#define __AAC_DECODER_H__


#include <memory>
#include <vector>
#include <functional>

#ifdef __cplusplus
extern "C"
{
#endif

#include <aacdecoder_lib.h>

#ifdef __cplusplus
}
#endif


class AacDecoder
{
private:
    uint8_t _pcmBuffer[8192];
private:
    HANDLE_AACDECODER _handle;
public:
    AacDecoder();
    virtual ~AacDecoder();
public:
    void decode(std::shared_ptr<std::vector<char>> &packet,std::function<void(std::shared_ptr<std::vector<char>>&pcm,int32_t sample_rate,int32_t channel)> func);
};
#endif
